import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

//push
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err)
};

import Login from "../views/Login/Login";
import Article from "../views/Article/Article";
import ArticleDetails from "../views/Article/ArticleDetails";
import Search from "../views/search/Search";
import Classification from "../views/Classification/Classification";
import About from "../views/About/About";

const routes = [
  {
    path: '/',
    component: Article
  }, {
    path: '/login',
    component: Login
  },
  {
    path: '/article',
    component: Article
  },
  {
    path: '/details',
    component: ArticleDetails
  },
  {
    path: '/classification',
    component: Classification
  },
  {
    path: '/search',
    component: Search
  },
  {
    path:'/about',
    component: About
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router
